import 'package:flutter/material.dart';
import 'package:flutter_mwm/widget/text.dart';

class SliderView extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return _StateSlider();
  }
}

class _StateSlider extends State<SliderView> {
  final List<String> letterArray = ['A','B','C','D','E','F','G','H','I','J','K','L',
      'M','N','O','P','','Q','R','S','T','U','V','W','X','Y','Z','#'];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Color(0xFF051728),
        title: Text('SliderDemo'),
      ),
      body: GestureDetector(
        child: Container(
            decoration: BoxDecoration(
                color: Colors.grey[300],
                border: Border.all(color: Colors.white12, width: 2),
                borderRadius: BorderRadius.all(Radius.circular(15))),
            padding: EdgeInsets.all(8.0),
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: _listSlideView(),
            )),
        onTap: () {
          print('onTap');
        },
        onTapCancel: () {
          print('onTapCancel');
        },
        onLongPress: () {
          print('onLongPress');
        },
        onTapDown: (details) {
          print('onTapDown');
        },
        onTapUp: (details) {
          print('onTapUp');
        },
        onLongPressUp: () {
          print('onLongPressUp');
        },
        onLongPressEnd: (details) {
          print('onLongPressEnd');
        },
        onLongPressStart: (details) {
          print('onLongPressStart');
        },
        onLongPressMoveUpdate: (details) {
          print('dy-onLongPressMoveUpdate${details.localPosition.dy}');
          print('dx-onLongPressMoveUpdate${details.localPosition.dx}');
        },
        onVerticalDragDown: (details) {
          print('onVerticalDragDown');
        },
        onVerticalDragUpdate: (details) {
          print('onVerticalDragUpdate');
        },
        onVerticalDragEnd: (details) {
          print('onVerticalDragUpdate' );
        },
      ),
    );
  }

  String _selected(){

   return '';
  }

  List<Widget> _listSlideView() {
    List<Widget> list = List();
    Widget _itemWidget;
    for(String item in letterArray){
      _itemWidget = TextView(item,
          padding: EdgeInsets.only(top: 2),
          textAlign: TextAlign.center,
          textColor: Colors.black54,
          textSize: 18);
      list.add(_itemWidget);
    }
    return list;
  }
}
